package com.ebelter.bodyfatscale.ui.pager.bind;

import android.app.Activity;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;

import butterknife.ButterKnife;

/**
 * 设备绑定页页面父类
 */
public abstract class BasePagerBind {

    public static final String TAG = "BasePagerBind";

    private Activity mActivity;
    public View mRootView;// 布局对象

    private LayoutInflater lf;

    BasePagerBind(Activity aty) {
        this.mActivity = aty;
        lf = (LayoutInflater) mActivity.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        mRootView = lf.inflate(loadLayoutById(), null);
        ButterKnife.bind(this,mRootView);
        initViews();
    }

    protected int loadLayoutById() {
        return 0;
    }



    /**
     * 初始化布局
     */
    public abstract void initViews();

    public abstract void initData(Object data);

    public void onActivityDestroy(){
        lf = null;
        mActivity = null;
    }

}
